package cn.fresh.xuanyuan.module.trade.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 订单类目
 */
@Data
@Schema(description = "用户 App - 子单类目")
public class AddOrderItemDto {

    @Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "商品ID不能为空")
    private Long productId;

    @Schema(description = "规格ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "规格ID不能为空")
    private Long skuId;

    @Schema(description = "购买数量", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "购买数量不能为空")
    @Min(value = 1, message = "至少购买一件商品")
    @Max(value = 100, message = "单个商品最多只能购买100件")
    private Integer buyNum;
}
